<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Welcome to MSHD!</title>
    <link rel="stylesheet" type="text/css" href="/static/css/style.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_1091410_zwryxsfgd4.css">
    <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
    <script>
        var token_csrf = "{{ csrf_token }}";


        function func(value) {
            //alert(value);
            $.ajax({
                headers: {"X-CSRFToken": token_csrf},
                type: "post",
                url: "/test_url/",
                /*contentType:"application/json; charset=UTF-8",
                data:{'data':JSON.stringify(value)},*/
                data: {"data1": value},
                success: function (arg) {
                    /* $("#i3").val(arg)*/
                }
            })
        }


    </script>

</head>
<body>
<header class="header">
    <div class="header_right">
        <ul>
            <li class="show_list"><a type="button" href="/" style="text-align:center;padding: 30px 30px 30px 30px;
                line-height: 60px;text-decoration: none;border: none;color:#ffffff;">首页</a></li>
            <li class="show_list" id="showList2">
                <span>人员伤亡及失踪</span>
                <div style="position: absolute;z-index: 999">
                <ul class="move_list">
                    <a type="button" name="101"  onclick="func(this.name)">死亡</a>
                    <a type="button" name="102"  onclick="func(this.name)">受伤</a>
                    <a type="button" name="103" onclick="func(this.name)">失踪</a>
                </ul>
                </div>
            </li>
            <li class="show_list" id="showList3">
                <span>房屋破坏</span>
                <div style="position: absolute;z-index: 999">
                <ul class="move_list">
                    <a type="button" name="201" onclick="func(this.name)">土木</a>
                    <a type="button" name="202"  onclick="func(this.name)">砖木</a>
                    <a type="button" name="203"  onclick="func(this.name)" x>砖混</a>
                    <a type="button" name="203"  onclick="func(this.name)">框架</a>
                    <a type="button" name="203"  onclick="func(this.name)">其他</a>
                </ul>
                </div>
            </li>
            <li class="show_list">
                <span>生命线工程灾情</span>
                <div style="position: absolute;z-index: 999">
                <ul class="move_list">
                    <a type="button" name="331" href="/data/331" >交通</a>
                    <a type="button" name="332" href="/data/332" >供水</a>
                    <a type="button" name="333" href="/data/333" >输油</a>
                    <a type="button" name="334" href="/data/334" >燃气</a>
                    <a type="button" name="335" href="/data/335" >电力</a>
                     <a type="button" name="336" href="/data/336" >通信</a>
                     <a type="button" name="337" href="/data/337" >水利</a>
                </ul>
                </div>
            </li>
            <li class="show_list">
                <span>次生灾害</span>
                <div style="position: absolute;z-index: 999">
                <ul class="move_list">
                    <a type="button" name="401"  onclick="func(this.name)">崩塌</a>
                    <a type="button" name="402" onclick="func(this.name)">滑坡</a>
                    <a type="button" name="203"  onclick="func(this.name)">泥石流</a>
                    <a type="button" name="203" onclick="func(this.name)">岩溶塌陷</a>
                    <a type="button" name="203" onclick="func(this.name)">地裂缝</a>
                    <a type="button" name="203" onclick="func(this.name)">地面沉降</a>
                    <a type="button" name="203"  onclick="func(this.name)">其他</a>
                </ul>
                </div>
            </li>
            <li class="show_list" id="showList2">
                <span>震情</span>
                <div style="position: absolute;z-index: 999">
                <ul class="move_list">
                    <a type="button" name="101"  onclick="func(this.name)">基本</a>
                    <a type="button" name="102"  onclick="func(this.name)">灾情预测</a>
                </ul>
                </div>
            </li>
        </ul>
    </div>
</header>
<div class="wrap">
    <div id="left" style=" width:100%">
        <div style="margin:0 auto; text-align:center;color:whitesmoke;">
            <h4 id="type" style="margin-bottom: 50px">多源异构灾情数据综合管理系统_灾情信息:{{ type }}展示</h4>
            <form method="POST" action="/data">
                {% csrf_token %}
                <div style="margin:auto;width: 73%;background-color: #4f4f4f;opacity: 0.8">
                    <table id="list_table" style="margin:10px auto;padding-top: 30px;padding-bottom: 30px">

                        {% for item in items %}
                            <tr>
                                <div>
                                    {% if forloop.counter|divisibleby:"2" %}
                                        <td style="width:50%;position: absolute;right: -15px;">
                                            <div>
                                                <table id="list_table1" border="0" width="500px" height="180px"
                                                       cellspacing="0" cellpadding="10"
                                                       style="border:1px solid #D3D3D3;position:absolute;top: -182px;">

                                                    <tbody align="left" valign="center">
                                                    <tr>
                                                        {% if request.session.user_role == "manager" %}
                                                        <td rowspan="7" valign="center">
                                                            <input name="select" type="radio" value="{{ item.0 }}"/></td>
                                                        {% endif %}
                                                        <td rowspan="7" align="center" style="width:200px">
                                                            <img src="{{ item.6 }}" width="150px" height="150px"></td>
                                                        <td style="width:200px;font-size:25px;font-family:宋体">地点:
                                                            <input name="fixLocation{{ item.0 }}" type="text" value="{{ item.3 }} " style="{{ BACKGROUND_COLOR }}"/></td>
                                                        <td style="width:100px;height:20px;font-size:15px;font-family:宋体" align="center">
                                                            <div style="background-color:red;color:white;border-radius:6px;">严重等级:
                                                                <input name="fixGrade{{ item.0 }}" type="text" value="{{ item.5 }}" style="{{ BACKGROUND_COLOR }};width: 10px"/>
                                                            </div>
                                                        </td>
                                                    </tr>

                                                    <tr>
                                                        <td colspan="2"
                                                            style="width:300px;font-size:15px;font-family:宋体">
                                                            类型:{{ item.4 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"
                                                            style="width:300px;font-size:15px;font-family:宋体">
                                                            顺序号:{{ item.9 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"
                                                            style="width:300px;font-size:15px;font-family:宋体">
                                                            编码:{{ item.1 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"
                                                            style="width:300px;font-size:15px;font-family:宋体">
                                                            上报单位:{{ item.8 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"
                                                            style="width:300px;font-size:15px;font-family:宋体">日期:
                                                            <input name="fixDate{{ item.0 }}" type="text"
                                                                   value="{{ item.2 }} "
                                                                   style="{{ BACKGROUND_COLOR }}"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"
                                                            style="width:300px;font-size:10px;font-family:微软雅黑;color:cornsilk">
                                                            详情:{{ item.7 }}</td>
                                                    </tr>

                                                </table>
                                            </div>
                                        </td>


                                    {% else %}

                                        <td style="width:50%">
                                            <div>
                                                <table id="list_table2" border="0" width="500px" height="180px" cellspacing="0" cellpadding="10" style="border:1px solid #D3D3D3;margin-left: 20px">

                                                    <tbody align="left" valign="center">
                                                    <tr>
                                                        {% if request.session.user_role == "manager" %}
                                                        <td rowspan="7" valign="center"><input name="select" type="radio" value="{{ item.0 }}"/></td>
                                                        {% endif %}
                                                        <td rowspan="7" align="center" style="width:200px">
                                                        <img src="{{ item.6 }}" width="150px" height="150px"></td>
                                                        <td style="width:200px;font-size:25px;font-family:宋体">地点:
                                                            <input name="fixLocation{{ item.0 }}" type="text" value="{{ item.3 }} " style="{{ BACKGROUND_COLOR }}"/></td>
                                                        <td style="width:100px;height:20px;font-size:15px;font-family:宋体" align="center">
                                                            <div style="background-color:red;color:white;border-radius:6px">
                                                                严重等级:
                                                                <input name="fixGrade{{ item.0 }}" type="text" value="{{ item.5 }}" style="{{ BACKGROUND_COLOR }};width: 10px"/>
                                                            </div>
                                                        </td>
                                                    </tr>

                                                    <tr>
                                                        <td colspan="2" style="width:300px;font-size:15px;font-family:宋体">类型:{{ item.4 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="width:300px;font-size:15px;font-family:宋体">顺序号:{{ item.9 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="width:300px;font-size:15px;font-family:宋体">编码:{{ item.1 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="width:300px;font-size:15px;font-family:宋体">上报单位:{{ item.8 }}</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="width:300px;font-size:15px;font-family:宋体">日期:
                                                            <input name="fixDate{{ item.0 }}" type="text" value="{{ item.2 }} " style="{{ BACKGROUND_COLOR }}"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="width:300px;font-size:10px;font-family:微软雅黑;color:cornsilk">详情:{{ item.7 }}</td>
                                                    </tr>

                                                </table>

                                            </div>
                                        </td>

                                    {% endif %}

                                </div>
                            </tr>

                        {% endfor %}

                    </table>
                </div>

                <div>
                    {% if request.session.user_role == "manager" %}
                    <input name="submit" class="submit_btn" type="submit" value="删除" style="margin-bottom: 100px"/>
                    <input name="submit" style="margin-left: 50px" class="submit_btn" type="submit"
                           value="{{ submit_value }}"/>
                    {% endif %}
                </div>
            </form>

        </div>

    </div>
</div>


</body>
</html>
